/**
 * @file 16.c
 * @author your name (you@domain.com)
 * @brief 回文串
 * @version 0.1
 * @date 2022-04-13
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#include <stdio.h>

int main()
{
    int n, reversedInteger = 0, remainder, originalInteger;
    printf("Enter an integer:");
    scanf("%d", &n);
    originalInteger = n;
    // reversed integer is stored in variable
    while (n != 0)
    {
        remainder = n % 10;
        reversedInteger = reversedInteger * 10 + remainder;
        n /= 10;
    }
    // palindrome if orignalInteger and resersedInteger is equal
    if (originalInteger == reversedInteger) {
        printf("%d is a palindrome.", originalInteger);
    } else {
        printf("%d is not a palindrome.", originalInteger);
    }
    return 0;    
}